<%@ page language="java" import="Reservation.*,
Application.Dao.*,java.util.*,java.text.SimpleDateFormat"%>

<%
	response.setContentType("text/xml");
	response.setHeader("Cache-Control", "no-store"); //HTTP1.1
	response.setHeader("Pragma", "no-cache"); //HTTP1.0
	response.setDateHeader("Expires", 0); //prevents catching at proxy server
	// System.out.println(request.getParameter("email"));
	//check the database
	String fromTime = request.getParameter("from");
	String toTime = request.getParameter("to");
	String num = request.getParameter("num");
	System.out.println(fromTime);
	SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	Date from = formatter.parse(fromTime);
	Date to = formatter.parse(toTime);
	System.out.println(from);
	int numberOfPeople = Integer.parseInt(request.getParameter("num"));
	int table = ReservationDAO.getTable(from, to, numberOfPeople); 


	response.getWriter().write("<table>"+table+"</table>");
%>

